<template>
  <div class="loading-container" v-if="loading">
    <div class="loading-mask">
      <div class="loading-spinner">
        <i class="el-icon-loading"></i>
        <p class="loading-text">{{ text }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TechLoading',
  props: {
    loading: {
      type: Boolean,
      default: true
    },
    text: {
      type: String,
      default: '数据加载中...'
    }
  }
}
</script>

<style scoped>
.loading-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.loading-mask {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-spinner {
  text-align: center;
}

.loading-spinner i {
  font-size: 32px;
  color: #409EFF;
}

.loading-text {
  margin-top: 10px;
  font-size: 14px;
  color: #606266;
}
</style> 